Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue for orphan items for sitecore 10.4 #469

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

Jaya21-git
Copy link
Contributor

Fixed issue for orphan items for sitecore 10.4

Fixed issue for orphan items for sitecore 10.4
@@ -36,6 +36,7 @@ public static string GetItemUrl(Item item, UrlOptions urlOptions)
{
#if SC104
if (item?.Paths == null) return string.Empty;
if (item?.Paths.FullPath.Contains("[orphan]") && item?.Parent == null) return string.Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item?.Paths.FullPath is an expensive operation. This also contains magic strings.

Copy link
Contributor Author

@Jaya21-git Jaya21-git Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muso31 Issue is coming for orphan items where item.parent is null but we cannot add only this check because for root item also parent is null. So added check for fullpath "[orphan]/renderingParameters"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muso31 Thanks for flagging. Replaced item?.Paths.FullPath check with item?.Paths.IsFullyQualified. This will come false for all orphan items.

@muso31 muso31 merged commit f819e48 into mikeedwards83:master Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants